package com.ruoyi.dynamic.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.dynamic.domain.PwLike;
import com.ruoyi.dynamic.service.IPwLikeService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/dynamic/like")
public class LikeController extends BaseController {
    @Resource
    private IPwLikeService pwLikeService;

    /**
     * 添加点赞
     * @param PwLike
     * @return
     */
    @PostMapping("/add")
    public AjaxResult add(@RequestBody PwLike PwLike) {
        return toAjax(pwLikeService.add(PwLike));
    }
    /**
     * 删除点赞
     * @param PwLike
     * @return
     */
    @DeleteMapping("/delete")
    public AjaxResult delete(@RequestBody PwLike PwLike) {
        return toAjax(pwLikeService.delete(PwLike));
    }

}
